################
#PSRM: Explaining Support for Redistribution: Social Insurance Systems and Fairness
#
#Observational Data: Eurobarometer
#Figure C 11
#
#Verena Fetscher
#July 2022
####################



####################
# Load data
####################
# EB
load("EB_benefits_17.Rda")



##################
# Fairness Beliefs and Redistribution Preferences
####################


##########################
#Figure C.11: Benefit concentration and beliefs in the importance of knowing the right people.
##########################

df_merge%>%
  filter(incgroup==3)%>%
  ggplot(aes(x = rr, y = imp_connections,label=cntry)) +
  stat_summary(fun.data = mean_se,aes(color="rich"),alpha=.5)+
  geom_smooth(method=lm,se=F,color="grey20",na.rm=T,size=.5)+
  xlab("Benefit concentration")+ ylab("Importance connections")+
  coord_cartesian(ylim=c(3, 4.5), xlim=c(0,.9))+
  stat_summary(aes(label=cntry), fun="mean", geom="text", 
               hjust=0.5, vjust=-.8,size=6)+
  scale_colour_manual(name="Income group", 
                      values=c("grey20"),
                      breaks = c("rich"),
                      labels = c("rich")
  )+
  scale_x_continuous(expand = c(0, 0)) + 
  scale_y_continuous(expand = c(0, 0)) +
  theme_bw()+
  theme(panel.border=element_blank(),axis.line=element_line(),
        legend.position="none",legend.text = element_text(size = 18),
        legend.title = element_text(size=18),axis.text=element_text(size=18),
        axis.title=element_text(size=22)
  )


ggsave(file="figure_c11.pdf", height = 5.83, width = 8.27, units = "in")
